package com.peg.rules;

import com.peg.dataobjects.Context;

/**
 * @author sad
 */
public class Optional extends Rule {

    public Optional(Rule rule) {
        setRule(rule);
    }

    public Optional() {
    }

    @Override
    public boolean execute(Context context) {
        Rule rule=getRule();
        executeRule(rule, context);
        return true;
    }

    @Override
    public String toString() {
        return "Optional";
    }
}
